home *** CD-ROM | disk | FTP | other *** search
- Path: newsflash.concordia.ca!not-for-mail
- From: v_ruso@alcor.concordia.ca
- Newsgroups: comp.lang.c
- Subject: Problem with scanf
- Date: Thu, 21 Mar 1996 22:52:59 GMT
- Organization: Concordia University, Montreal, Canada
- Message-ID: <4iscgb$8h9@newsflash.concordia.ca>
- NNTP-Posting-Host: alcor.concordia.ca
- NNTP-Posting-User: v_ruso
- X-Newsreader: Forte Free Agent 1.0.82
-
- I am writing a program that is supposed to gather information from the
- user.
- The program works fine if the user enters some numbers and presses
- enter. But if the user just presses enter without entering any data,
- the cursor just starts a new line.
- Can anyone tell me how I can avoid this?
- this is the part of the code i am refering to:
- .
- .
- gotoxy (13,22);
- cprintf ("The maximum load the cylinder is expected to handle");
- gotoxy (15,10);
- cprintf ("Enter the Maximum Axial Load [Lbf]: ");
- xlocation = wherex();
- gotoxy (xlocation,10);
- scanf ("%f",&maxload);
-
-
- where maxload is a float type variable..
-
- Any help would be appreciated.
-
- Thanks.
- Vince R.
-
-